<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('科技管家文案列表')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.addnoticFull()" shiro:hasPermission="system:science:add">
                <i class="fa fa-plus"></i> 添加岗位
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:join:edit')}]];
    var listFlag = [[${@permission.hasPermi('system:join:list')}]];
    var removeFlag = [[${@permission.hasPermi('system:join:remove')}]];
    var prefix = ctx + "system/join";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "岗位管理",
            columns: [
            {
                field: 'id',
                title: '序号'
            },
            {
                field: 'post',
                title: '岗位名称',
                sortable: false
            },
            {
                field: 'site',
                title: '地点',
                sortable: false
            },
            {
                field: 'education',
                title: '学历'
            },
            {
                field: 'year',
                title: '工作年限'
            },
            {
                field: 'createTime',
                title: '创建时间'
            },
            {
                title: '操作',
                align: 'center',
                formatter: function(value, row, index) {
                    var actions = [];
                    actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
                    actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                    return actions.join('');
                }
            }]
        };
        $.table.init(options);
    });

    /*字典列表-详细*/
    function detail(id) {
        var url = prefix + '/detail/' + id;
        $.modal.openTab("标签数据", url);
    }

    function statusTools(row) {
		    if (row.status == 1) {
    			return '正常';
    		} else {
    			return '禁用';
    		}
		}

    function updateStatus(data){
        $.operate.get(prefix + "/status?id=" + data);
    }

    function details(data){
        $.modal.openFull("会议详情",prefix + "/detail/" + data);
    }
</script>
</body>
</html>